<?php

namespace asyncService\lib;

use asyncService\mainService;

class ProcessHandle {

	public $run = true;

	protected $worker;

	/**
	 * @var mainService
	 */
	protected $mainService;

	function __construct($worker,$mainService) {

		$this->worker = $worker;

		$this->mainService = $mainService;

	}

	public function handle(){

        log::getInstance()->info(__CLASS__." handle ");

		while($this->run){
            $this->callback();
		}

        if($this->run === false){
            log::getInstance()->info(__CLASS__." is end! ");
            $this->worker->exit();
        }

	}

	public function callback(){}



}